package com.yusys.thread;

public class Cat extends Thread {

    int times = 0;

    @Override
    public void run() {
        while (true) {
            // 该线程每隔1秒钟，在控制台输出"喵喵，我是小猫咪"
            System.out.println("喵喵，我是小猫咪" + (++times) + ", 线程名 = " + Thread.currentThread().getName());
            try {
                Thread.sleep(1000);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
            if (times == 80) {
                break;
            }
        }
    }
}
